<template>
  <div>
    <button @click="getStudents">获取学生信息</button>
    <button @click="getCars">获取汽车信息</button>
  </div>
</template>

<script>
import axios from 'axios';
export default {
    name:'App',
    methods:{
      getStudents(){
        axios.get('http://localhost:8080/trent/students') .then((result) => {
          console.log('#请求成功',result.data);
        }).catch((err) => {
          console.log('#请求失败',err.message);
        });
      },
      getCars(){
        axios.get('http://localhost:8080/demo/cars') .then((result) => {
          console.log('@请求成功',result.data);
        }).catch((err) => {
          console.log('@请求失败',err.message);
        });
      }
    }
}
</script>